package com.ibm.finance.tools.wwcet.util.hdsc;

import java.lang.*;
import com.ibm.finance.tools.wwcet.util.hdsc.*;

/**
 * This class is a container for exporting parameters for a single database table. These parameters are used by DBDataExporter. It's assumed that this class will be initialized with Spring setter dependency injection only.
 * 
 * Thread Safety:
 * This class is mutable and not thread safe.
 */
public class DBTableExportParameters {
    /**
     * The format of the file with the exported data. Is initialized via Spring setter injection. Cannot be null after initialization (note that actual check is performed in checkInit() method). Has getter and setter.
     */
    private ExportFileFormat format;

    /**
     * The name of the table from which records should be exported. Can contain schema name. Is initialized via Spring setter injection. Cannot be null or empty after initialization (note that actual check is performed in checkInit() method). Has getter and setter.
     */
    private String tableName;

    /**
     * The content of the WHERE clause of SQL statement to be used when matching the records to be exported. Should not include the "WHERE" keyword. Is initialized via Spring setter injection. Cannot be null/empty after initialization (note that actual check is performed in checkInit() method). Has getter and setter.
     */
    private String selectCriteria;

    /**
     * The path template of the file to which data are exported. Both relative and absolute paths are supported. This template can contain %TIMESTAMP:format% fields that are replaced with the current date/time using the specified format. See javadoc of SimpleDateFormat for details about the format parameter. Is initialized via Spring setter injection. Cannot be null or empty after initialization (note that actual check is performed in checkInit() method). Has getter and setter.
     */
    private String exportFilePathTemplate;

    /**
     * The value indicating whether purge of the exported data is required. If true, the exported records are removed from the database. Can be initialized via Spring setter injection. Has getter and setter.
     */
    private boolean purgeRequired;

    /**
     * The value indicating whether the exported file should be compressed to a ZIP file. ZIP file name is generated by appending ".zip" extension to the original file name (the original export file extension is not removed). Can be initialized via Spring setter injection. Has getter and setter.
     */
    private boolean zipRequired;

    /**
     * The code page to be used in the export file. Can be specified for DEL and IXF formats only. If null, a default DB format is used. Is initialized via Spring setter injection. Cannot be empty after initialization, must be null for WSF format (note that actual check is performed in checkInit() method). Has getter and setter.
     */
    private String codePage;

    /**
     * The column separator. Should be a single character or character code in format "0xDD", where D represents a HEX digit (case insensitive). Can be specified for DEL format only. If null, a default DB separator is used. Can be initialized via Spring setter injection. Note that actual check of this field is performed in checkInit() method. Has getter and setter.
     */
    private String columnSeparator;

    /**
     * The character string delimiter used for enclosing character strings. Should be a single character or character code in format "0xDD", where D represents a HEX digit (case insensitive). Can be specified for DEL format only. If null, a default DB delimiter is used. Can be initialized via Spring setter injection. Note that actual check of this field is performed in checkInit() method. Has getter and setter.
     */
    private String stringDelimiter;

    /**
     * The format of timestamps in the export file. Can be specified for DEL format only. If null, a default DB format is used. Is initialized via Spring setter injection. Cannot be empty after initialization (note that actual check is performed in checkInit() method). Has getter and setter.
     * Details about the used format can be found here: http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.admin.cmd.doc/doc/r0008303.html
     */
    private String timestampFormat;

    /**
     * The character to be used as a decimal point. Should be a single character or character code in format "0xDD", where D represents a HEX digit (case insensitive). Can be specified for DEL format only. If null, a default DB separator is used. Can be initialized via Spring setter injection. Note that actual check of this field is performed in checkInit() method. Has getter and setter.
     */
    private String decimalPoint;

    /**
     * The value indicating whether leading zeros must be stripped for all decimal columns in the export file. Can be initialized via Spring setter injection. Can be true for DEL format only (note that actual check of this field is performed in checkInit() method). Has getter and setter.
     */
    private boolean leadingZeroStripped;

    /**
     * The value indicating whether leading plus sign must be removed for all positive decimal values in the export file. Can be initialized via Spring setter injection. Can be true for DEL format only (note that actual check of this field is performed in checkInit() method). Has getter and setter.
     */
    private boolean plusSignRemoved;

    /**
     * Creates an instance of DBTableExportParameters.
     * 
     * Implementation Notes:
     * Do nothing.
     */
    public DBTableExportParameters() {
    }

    /**
     * Checks whether this class was initialized by Spring properly. It must be configured as "init-method" in Spring bean configuration.
     * 
     * Throws:
     * DBDataExporterInitializationException if the class was not initialized properly (e.g. when required properly is not specified or property value has invalid format)
     * 
     * Implementation Notes:
     * 1. If format == null then throw DBDataExporterInitializationException.
     * 2. If table is null or empty then throw DBDataExporterInitializationException.
     * 3. If selectCriteria is null or empty then throw DBDataExporterInitializationException.
     * 4. If exportFilePathTemplate is null or empty then throw DBDataExporterInitializationException.
     * 5. If codePage is empty then throw DBDataExporterInitializationException.
     * 6. If codePage != null and format == ExportFileFormat.WSF then throw DBDataExporterInitializationException.
     * 7. If columnSeparator != null and columnSeparator.length() != 1 and columnSeparator doesn't have format "0xDD" (where D represents a HEX digit, case insensitive), then throw DBDataExporterInitializationException.
     * 8. Similarly check stringDelimiter and decimalPoint (like columnSeparator is checked in the previous step).
     * 9. If timestampFormat is empty then throw DBDataExporterInitializationException.
     * 9. If format != ExportFileFormat.DEL and (columnSeparator != null or stringDelimiter != null or timestampFormat != null or decimalPoint != null or leadingZeroStripped or plusSignRemoved) then throw DBDataExporterInitializationException.
     * @throws DBDataExporterInitializationException if the class was not initialized properly (e.g. when required properly is not specified or property value has invalid format)
     */
    protected void checkInit() {
    }

    /**
     * Retrieves the format of the file with the exported data.
     * 
     * Returns:
     * the format of the file with the exported data
     * @return the format of the file with the exported data
     */
    public ExportFileFormat getFormat() {
        return null;
    }

    /**
     * Sets the format of the file with the exported data.
     * 
     * Parameters:
     * format - the format of the file with the exported data
     * @param format the format of the file with the exported data
     */
    public void setFormat(ExportFileFormat format) {
    }

    /**
     * Retrieves the name of the table from which records should be exported.
     * 
     * Returns:
     * the name of the table from which records should be exported
     * @return the name of the table from which records should be exported
     */
    public String getTableName() {
        return null;
    }

    /**
     * Sets the name of the table from which records should be exported.
     * 
     * Parameters:
     * tableName - the name of the table from which records should be exported
     * @param tableName the name of the table from which records should be exported
     */
    public void setTableName(String tableName) {
    }

    /**
     * Retrieves the content of the WHERE clause of SQL statement to be used when matching the records to be exported.
     * 
     * Returns:
     * the content of the WHERE clause of SQL statement to be used when matching the records to be exported
     * @return the content of the WHERE clause of SQL statement to be used when matching the records to be exported
     */
    public String getSelectCriteria() {
        return null;
    }

    /**
     * Sets the content of the WHERE clause of SQL statement to be used when matching the records to be exported.
     * 
     * Parameters:
     * selectCriteria - the content of the WHERE clause of SQL statement to be used when matching the records to be exported
     * @param selectCriteria the content of the WHERE clause of SQL statement to be used when matching the records to be exported
     */
    public void setSelectCriteria(String selectCriteria) {
    }

    /**
     * Retrieves the path template of the file to which data are exported.
     * 
     * Returns:
     * the path template of the file to which data are exported
     * @return the path template of the file to which data are exported
     */
    public String getExportFilePathTemplate() {
        return null;
    }

    /**
     * Sets the path template of the file to which data are exported.
     * 
     * Parameters:
     * exportFilePathTemplate - the path template of the file to which data are exported
     * @param exportFilePathTemplate the path template of the file to which data are exported
     */
    public void setExportFilePathTemplate(String exportFilePathTemplate) {
    }

    /**
     * Retrieves the value indicating whether purge of the exported data is required.
     * 
     * Returns:
     * the value indicating whether purge of the exported data is required
     * @return the value indicating whether purge of the exported data is required
     */
    public boolean isPurgeRequired() {
        return false;
    }

    /**
     * Sets the value indicating whether purge of the exported data is required.
     * 
     * Parameters:
     * purgeRequired - the value indicating whether purge of the exported data is required
     * @param purgeRequired the value indicating whether purge of the exported data is required
     */
    public void setPurgeRequired(boolean purgeRequired) {
    }

    /**
     * Retrieves the value indicating whether the exported file should be compressed to a ZIP file.
     * 
     * Returns:
     * the value indicating whether the exported file should be compressed to a ZIP file
     * @return the value indicating whether the exported file should be compressed to a ZIP file
     */
    public boolean isZipRequired() {
        return false;
    }

    /**
     * Sets the value indicating whether the exported file should be compressed to a ZIP file.
     * 
     * Parameters:
     * zipRequired - the value indicating whether the exported file should be compressed to a ZIP file
     * @param zipRequired the value indicating whether the exported file should be compressed to a ZIP file
     */
    public void setZipRequired(boolean zipRequired) {
    }

    /**
     * Retrieves the column separator.
     * 
     * Returns:
     * the column separator
     * @return the column separator
     */
    public String getColumnSeparator() {
        return null;
    }

    /**
     * Sets the column separator.
     * 
     * Parameters:
     * columnSeparator - the column separator
     * @param columnSeparator the column separator
     */
    public void setColumnSeparator(String columnSeparator) {
    }

    /**
     * Retrieves the character string delimiter used for enclosing character strings.
     * 
     * Returns:
     * the character string delimiter used for enclosing character strings
     * @return the character string delimiter used for enclosing character strings
     */
    public String getStringDelimiter() {
        return null;
    }

    /**
     * Sets the character string delimiter used for enclosing character strings.
     * 
     * Parameters:
     * stringDelimiter - the character string delimiter used for enclosing character strings
     * @param stringDelimiter the character string delimiter used for enclosing character strings
     */
    public void setStringDelimiter(String stringDelimiter) {
    }

    /**
     * Retrieves the format of timestamps in the export file.
     * 
     * Returns:
     * the format of timestamps in the export file
     * @return the format of timestamps in the export file
     */
    public String getTimestampFormat() {
        return null;
    }

    /**
     * Sets the format of timestamps in the export file.
     * 
     * Parameters:
     * timestampFormat - the format of timestamps in the export file
     * @param timestampFormat the format of timestamps in the export file
     */
    public void setTimestampFormat(String timestampFormat) {
    }

    /**
     * Retrieves the code page to be used in the export file.
     * 
     * Returns:
     * the code page to be used in the export file
     * @return the code page to be used in the export file
     */
    public String getCodePage() {
        return null;
    }

    /**
     * Sets the code page to be used in the export file.
     * 
     * Parameters:
     * codePage - the code page to be used in the export file
     * @param codePage the code page to be used in the export file
     */
    public void setCodePage(String codePage) {
    }

    /**
     * Retrieves the character to be used as a decimal point.
     * 
     * Returns:
     * the character to be used as a decimal point
     * @return the character to be used as a decimal point
     */
    public String getDecimalPoint() {
        return null;
    }

    /**
     * Sets the character to be used as a decimal point.
     * 
     * Parameters:
     * decimalPoint - the character to be used as a decimal point
     * @param decimalPoint the character to be used as a decimal point
     */
    public void setDecimalPoint(String decimalPoint) {
    }

    /**
     * Retrieves the value indicating whether leading zeros must be stripped for all decimal columns in the export file.
     * 
     * Returns:
     * the value indicating whether leading zeros must be stripped for all decimal columns in the export file
     * @return the value indicating whether leading zeros must be stripped for all decimal columns in the export file
     */
    public boolean isLeadingZeroStripped() {
        return false;
    }

    /**
     * Sets the value indicating whether leading zeros must be stripped for all decimal columns in the export file.
     * 
     * Parameters:
     * leadingZeroStripped - the value indicating whether leading zeros must be stripped for all decimal columns in the export file
     * @param leadingZeroStripped the value indicating whether leading zeros must be stripped for all decimal columns in the export file
     */
    public void setLeadingZeroStripped(boolean leadingZeroStripped) {
    }

    /**
     * Retrieves the value indicating whether leading plus sign must be removed for all positive decimal values in the export file.
     * 
     * Returns:
     * the value indicating whether leading plus sign must be removed for all positive decimal values in the export file
     * @return the value indicating whether leading plus sign must be removed for all positive decimal values in the export file
     */
    public boolean isPlusSignRemoved() {
        return false;
    }

    /**
     * Sets the value indicating whether leading plus sign must be removed for all positive decimal values in the export file.
     * 
     * Parameters:
     * plusSignRemoved - the value indicating whether leading plus sign must be removed for all positive decimal values in the export file
     * @param plusSignRemoved the value indicating whether leading plus sign must be removed for all positive decimal values in the export file
     */
    public void setPlusSignRemoved(boolean plusSignRemoved) {
    }
}

